import java.awt.*;
import java.awt.event.*;

@SuppressWarnings("serial")
public class CS_Search extends Frame implements ActionListener{
	
	Button     course, prof, sem, year;
	public CS_Search() {
		super("CS_Search");
		setLayout(new BorderLayout());
		setLayout(new BorderLayout());
		

		Panel center = new Panel();
		
		Panel pcourse = new Panel();
		pcourse.add(course = new Button("Course"));
		course.addActionListener(this);
		
		Panel pro = new Panel();
		pro.add(prof = new Button("Professor"));
		prof.addActionListener(this);
		
		Panel pse = new Panel();
		pse.add(sem = new Button("Semester"));
		sem.addActionListener(this);
		
		Panel pyear = new Panel();
		pyear.add(year = new Button("Year"));
		year.addActionListener(this);
		
		center.add(pcourse);
		center.add(pro);
		center.add(pse);
		center.add(pyear);


		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				setVisible(false);
				dispose();
			}
		});
		add("Center", center);
	}

	public void actionPerformed(ActionEvent e) {
		Button c = (Button) e.getSource();
		try {
			if(c == course) {
				Seoyoung2.nCourse = 10;
				Seoyoung2.setEnable(Seoyoung2.SEARCH);
				this.dispose();
			}else if(c == prof){
				Seoyoung2.nCourse = 11;
				Seoyoung2.setEnable(Seoyoung2.SEARCH);
				this.dispose();
			}else if(c == sem){
				Seoyoung2.nCourse = 12;
				Seoyoung2.setEnable(Seoyoung2.SEARCH);
				this.dispose();
			}else if(c == year){
				Seoyoung2.nCourse = 13;
				Seoyoung2.setEnable(Seoyoung2.SEARCH);
				this.dispose();
			}
		} catch(Exception ex) { }

		return ;
	}

}
